﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Directory.Web.Search"
    Theme="Admin_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script>
        function ViewCategory(id) {
            window.open('categorydetails.aspx?categoryId=' + id);
        }
        function ViewItem(id) {
            window.open('Item.aspx?action=modify&itemId=' + id);
        }
    </script>

</head>
<body>
    <form id="form1" name="form1" runat="server">
    <div class="container">
        <div class="pageheader">
            关键字：<asp:TextBox ID="tbKeywords" runat="server" class="text"></asp:TextBox>
            搜索
            <asp:DropDownList ID="ddlSearchType" runat="server">
            </asp:DropDownList>
            <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" />
        </div>
        <div class="pagecontent">
            <asp:Literal ID="ltMsg" runat="server"></asp:Literal>
            <div class="child_List">
                <asp:Repeater ID="rptCateogrys" runat="server">
                    <HeaderTemplate>
                        <style type="text/css">
                            .f_itemcount_0:display:none;</style>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <img src="../imgs/fldr.gif" />
                            <a onclick="ViewCategory(<%# Eval("CategoryId") %>)">
                                <%# Eval("CategoryName") %></a> <font style='display: <%# Convert.ToInt32(Eval("ItemsCount","{0}"))>0?"":"none" %>'>
                                    <%# Eval("ItemsCount","({0})") %></font> </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ul></FooterTemplate>
                </asp:Repeater>
            </div>
            <div class="content_list">
                <asp:Repeater ID="rptItemsList" runat="server" OnItemDataBound="rptItemsList_ItemDataBound">
                    <HeaderTemplate>
                        <ol>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <p class="list_title">
                                <%# this.pageIndex*this.pageSize + Container.ItemIndex + 1 %>. <a onclick="ViewItem(<%# Eval("ItemId")%>)">
                                    <%# Eval("Title")%></a> &nbsp;-&nbsp;
                                <%# Eval("LinkUrl") %>
                                &nbsp; &nbsp; &nbsp; &nbsp; <span clas="ltCategoryPath"><strong>所属<% = Resources.Resource.ResourceManager.GetString("Category") %></strong>
                                    <asp:Literal ID="ltCategoryPath" runat="server"></asp:Literal><span>
                            </p>
                            <div class="compress">
                                <p class="ico">
                                    <a href="<%# Eval("LinkUrl") %>" target="_blank">
                                        <img src="<%# Eval("LogoPath")%>" /></a>
                                </p>
                                <%# Eval("Description")%>
                            </div>
                        </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ol></FooterTemplate>
                </asp:Repeater>
            </div>
            <p runat="server" id="pagebreak" visible="false">
                <asp:HyperLink ID="hplFirstPage" runat="server">第一页</asp:HyperLink>&nbsp;
                <asp:HyperLink ID="hplPrePage" runat="server">上一页</asp:HyperLink>&nbsp; 第&nbsp;<asp:Label
                    ID="lbCurrentPage" runat="server" Text=""></asp:Label>&nbsp;页&nbsp;
                <asp:HyperLink ID="hplNextPage" runat="server">下一页</asp:HyperLink>&nbsp;
                <asp:HyperLink ID="hplLastPage" runat="server">最后一页</asp:HyperLink>&nbsp; 总计&nbsp;<% = this.itemsRecords.ToString() %>&nbsp;条
            </p>
        </div>
    </div>
    </form>
</body>
</html>
